# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=qrca
pkgver=0_git20210401
pkgrel=1
_commit="4078952c38715ca59de3916e308bcd60fee00e34"
pkgdesc="QR-Code scanner for Plasma Mobile"
# armhf blocked by qt5-qtdeclarative
# ppc64le, s390x and riscv64 blocked by polkit -> purpose
arch="all !armhf !s390x !riscv64 !ppc64le"
url="https://invent.kde.org/plasma-mobile/qrca"
license="GPL-3.0-or-later"
depends="
	kirigami2
	purpose
	"
makedepends="
	extra-cmake-modules
	kcontacts-dev
	kcoreaddons-dev
	ki18n-dev
	kirigami2-dev
	purpose-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtmultimedia-dev
	qt5-qtquickcontrols2-dev
	qt5-qtsvg-dev
	samurai
	zxing-cpp-dev
	"
checkdepends="appstream"
source="https://invent.kde.org/plasma-mobile/qrca/-/archive/$_commit/qrca-$_commit.tar.gz"
builddir="$srcdir/$pkgname-$_commit"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="25f7046e2ef318105ee702fb4a1dc41876cd028f853fc9488e78d4ac92313c5604c4e61d015af9b0813d849d64b3c1d19f533c687e781660a85e52a6768a6fef  qrca-4078952c38715ca59de3916e308bcd60fee00e34.tar.gz"
